{include file="public/header" /}
<style>
body{
    background: #FFF;
}
 .page{
     min-height: auto;
 }
</style>
<div class="page">
<form method="post" name="remark_form" id="remark_form">
    <table class="ds-default-table nobdb">
    	    <tr>
                <td><label>授信额度：</label></td>
                <td><input  type="text"  name="credit_num"  value="<?php if(isset($member_info)&&!empty($member_info['credit_num'])){ echo $member_info['credit_num']; }?>"></td>
             </tr>
          <!--   <tr> <input type="hidden" name="member_id" value="{$member_info.member_id}">
              <td><label>授信开始时间：</label></td>
              <td> <input  type="text" id="sdate" name="credit_create_time" class="txt date" value="<?php if(isset($member_info)&&!empty($member_info['credit_create_time'])){ echo date('Y-m-d',$member_info['credit_create_time']); }?>"></td>
            </tr>
           <tr>
              <td><label>授信结束时间：</label></td>
              <td><input  type="text" id="edate" name="credit_end_time" class="txt date" value="<?php if(isset($member_info)&&!empty($member_info['credit_end_time'])){ echo date('Y-m-d',$member_info['credit_end_time']); }?>"></td>
           </tr> -->
           <tr> <input type="hidden" name="member_id" value="{$member_info.member_id}">
              <td><label>授信天数：</label></td>
              <td> <input  type="text"  name="credit_day" value="<?php if(isset($member_info)&&!empty($member_info['credit_day'])){
                echo $member_info['credit_day']; }?>"></td>
            </tr>
             <tr>
                 <td>
                    <input type="submit" class="submit" value="提交" style="float: left;">
                    <a  style="height:30px; margin-top: -1px; margin-left: 5px; line-height: 30px;" href="javascript:dsLayerConfirm('{:url('Member_da/cancel_credit',['member_id'=>$member_info.member_id])}','确认要清空授信吗？')" class="dsui-btn-del"><i class="iconfont"></i>清空授信</a>
                </td>
                <td></td>
              </tr>
        </table>
</form></div>


<script>


$(document).ready(function(){

	$('form').submit(function(){
		var credit_num = $("input[name='credit_num']").val();
    var credit_day = $("input[name='credit_day']").val();

		if(credit_num === "" || credit_num ==null){
      layer.msg('请设置正确的授信额度');return false;
　　}
     if(isNaN(credit_num)){　　　　
　　　  layer.msg('请设置正确的授信额度');return false;
　  　}
    if(credit_num<=0){　　　　
　　　  layer.msg('请设置正确的授信额度');return false;
　  　}
     if(!/^[0-9]*[1-9][0-9]*$/.test(credit_day)){
       layer.msg('请设置正确的授信天数');return false;

     }

	});
})

</script>
